home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1064 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: Randal Parsons <Randal.Parsons@btal.com.au>
  3. Newsgroups: comp.lang.c++.moderated,comp.std.c++
  4. Subject: Re: static members as members of a metaclass h
  5. Followup-To: comp.lang.c++.moderated
  6. Date: 12 Apr 1996 19:53:58 GMT
  7. Organization: Bankers Trust Australia Limited.
  8. Approved: austern@isolde.mti.sgi.com,vandevod@cs.rpi.edu
  9. Message-ID: <pgpmoose.199604121252.25489@isolde.mti.sgi.com>
  10. References: <4jc5lt$doh@arl-news-svc-2.compuserve.com> <4jckdc$ad6@engnews1.Eng.Sun.COM> <kywx3q1nox.fsf@gator.mit.edu>
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: Thu, 11 Apr 1996 15:21:46 +1100
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMW60kky4NqrwXLNJAQFk6QH+K7MCc4svYS71IXJiIoKIFQCk8pc8kqn8
  15.     bcSb1glljlCPStEDRNwTKkzFI7jAsgKJuNQrPZUp2SKEM3oJORW5Zw==
  16.     =RqUi
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. [c.s.c++ moderator's note: This thread has drifted away from the issue
  20. of how the C++ standard should address initialization of global static
  21. data.  I suggest that further discussion be conducted in
  22. comp.lang.c++.moderated.  mha]
  23.  
  24. Jeffrey C. Gealow wrote:
  25.  
  26. In article <4jckdc$ad6@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM
  27. (Steve Clamage) writes:
  28.  
  29.    I believe a reasonable solution to the problem of initialization of
  30.    non-local static data is not to use non-local static data!
  31.  
  32.    Instead of a static data object or static class data member, use a
  33.    function with a local static object.
  34.  
  35. But this adds the overhead of the function call mechanism to every use
  36. of the object.
  37.  
  38.  
  39. This may not be appropriate for this forum, but I have also found that
  40. it will cause the heap to be corrupted if such a function is called in
  41. a driver DLL under Win NT 3.51 and VC 4.0, although I have no idea
  42. why.  Global statics don't seem to have the same limitation.
  43.  
  44. Regards,
  45.  
  46. Randal.
  47. ---
  48. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  49.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  50.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  51.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  52.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  53. ]
  54.  
  55.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  56.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  57.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  58.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  59.  
  60.  
  61.